import axios from 'axios';
import * as contains from './contains';

export const getInfo = (title, content) => ({
	type: contains.GET_DETAIL_INFO,
	title,
	content
})

export const getDetail = (id) => {
	return (dispatch) => {
	    axios.get('/api/detail.json?id=' + id).then((res) => {
		const result = res.data.data;
		dispatch(getInfo(result.title, result.content))
	})
	}
}